<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/report/report/View_BomList.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/report/report/View_BomList.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ID',
                footer: "Foots",
                cnName: '构成表查询',
                name: 'report/View_BomList',
                url: "/View_BomList/",
                sortName: "ParentNumber"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"ParentNumber":"","SubNumber":""});
            const searchFormOptions = ref([[{"title":"父项产品编号","field":"ParentNumber","type":"like"},{"title":"子项物料编号","field":"SubNumber","type":"like"}]]);
            const columns = ref([{field:'BOMVersionCode',title:'版本号',type:'string',width:80,align:'left',sort:true},
                       {field:'FSN',title:'层级',type:'string',width:120,align:'left'},
                       {field:'ParentID',title:'父项ID',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'ParentNumber',title:'父项产品编号',type:'string',sort:true,width:180,require:true,align:'left'},
                       {field:'ParentName',title:'父项产品名称',type:'string',width:120,require:true,align:'left'},
                       {field:'SubID',title:'子项ID',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'SubNumber',title:'子项物料编号',type:'string',sort:true,width:180,require:true,align:'left'},
                       {field:'SubName',title:'子项物料名称',type:'string',width:120,require:true,align:'left'},
                       {field:'SubModel',title:'规格型号',type:'string',width:220,align:'left'},
                       {field:'FErpClsID',title:'属性ID',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'FType',title:'类别',type:'string',width:80,require:true,align:'left'},
                       {field:'Property',title:'属性',type:'string',width:80,require:true,align:'left'},
                       {field:'FQty',title:'用量',type:'decimal',width:80,align:'left'},
                       {field:'FLoss',title:'损耗率',type:'decimal',width:80,align:'left'},
                       {field:'SupplierCode',title:'默认供应商代码',type:'string',width:100,require:true,align:'left'},
                       {field:'SupplierName',title:'默认供应商名称',type:'string',width:180,require:true,align:'left'},
                       {field:'PurMinQty',title:'最小采购量',type:'decimal',width:100,align:'left'},
                       {field:'ID',title:'ID',type:'guid',width:110,hidden:true,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
